(function () {
    function Notify() {
        Notify.super(this);

        this.notify = null;
        this.init();
    }
    Laya.class(Notify, "Com.Home.Notify", ui.Home.NotifyUI);
    var _proto = Notify.prototype;

    _proto.init = function () {
        var confFont = {
            height   : 38,
            font     : "Microsoft Yahei",
            fontSize : 22,
            color    : "#ffffff",
            valign   : "middle"
        };
        var notify = new com.notify(confFont, 200);
            notify.size(480, 38);
            notify.pos(70, 0);

        this.notify = notify;
        this.addChild(notify);
    }
    _proto.addNotify = function (data) {
        var notifyData = data.contents;
        for(var i in notifyData){
            this.notify.add(notifyData[i].content);
        }
    }
    _proto.loop = function () {
        $.ajax({
            type     : 'GET',
            url      : "/?act=gamenotice&st=get_game_notice&gameId=" + gameId + "&platformatype=" + platformatype,
            dataType : 'json',
            timeout  : 10000,
            success  : function (data) {
                this.addNotify && this.addNotify(data);
            }.bind(this)
        });
    }
    _proto.update = function () {
        console.log("Notify Update")
        this.loop();
        Laya.timer.loop(5 * 60 * 1000, this, this.loop);
    }
})();